<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
	"http://www.w3.org/TR/html4/loose.dtd">

<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<title>JSP Page</title>
	</head>
	<body>
		<h3>My Login</h3>

		<c:if test="${param.error == true}">
			Login Failure<br>
			${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}
		</c:if>

		<form action="${pageContext.request.contextPath}/j_spring_security_check" style="width:260px;text-align:center;">
			<fieldset>
				<legend>Login</legend>
				Username: <input type="text" name="j_username" style="width:150px;" value="${sessionScope['SPRING_SECURITY_LAST_USERNAME']}"/><br />
				Password: <input type="password" name="j_password" style="width:150px;" /><br />
				<input type="checkbox" name="_spring_security_remember_me" />Remember Me<br />
				<input type="submit" value="Login"/>
				<input type="reset" value="Reset"/>

				<ul>
					<li style="text-align: left;"><a href="${pageContext.request.contextPath}/j_spring_security_check?j_username=admin&j_password=admin">Auto login as admin</a></li>
					<li style="text-align: left;"><a href="${pageContext.request.contextPath}/j_spring_security_check?j_username=user&j_password=user">Auto login as user</a></li>
				</ul>
			</fieldset>	
		</form>
    </body>
</html>
